 
 <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/index.php/my/index/index.html">首页</a><span class="crumb-step">&gt;</span><span class="crumb-step">&gt;</span><span>佣金参数配置</span></div>
        </div>
		
		 <div class="search-wrap">
            <div class="search-content">
                <form action="{:U('System/kouliangpeizhi')}" method="post">
                    <table class="search-tab">
                        <tr>
                           
                           
                            <td>
							&nbsp;&nbsp;&nbsp;&nbsp;每个链接第
							<input class="common-text"   id="num" type="text">
							
							个进行扣量
							</td>
                            <td><input class="btn btn-primary btn2" onclick="addkouliang()"  value="现在添加" type="BUTTON"></td>
							
							<script>
							  
							  function addkouliang(){
							  
							   var num=$('#num').val();
							  
							    $.post("{:U('System/kouliang')}",{"num":num},function(re){
								
								  if(re==1){
								  
								    alert('添加成功');location.reload();
								  
								  }
								
								  if(re==2){
								  
								    alert('添加失败');
								  
								  }
								  
								  if(re==3){
								  
								    alert('已经添加过该位置的扣量');
								  
								  }
								
								
								
								})
							  
							  
							  }
							
							
							</script>
							
							
							
							  <th style="width:200px;"><i class="require-red">*</i>是否开启扣量：</th>
                                <td>
                                    <if condition="$sys.iskouliang eq 1">
									  <input type="radio" name="iskouliang" checked value="1"/> 开启 &nbsp;&nbsp;&nbsp;&nbsp;
									  <input type="radio" name="iskouliang" value="2"/> 关闭
									<else/>
									
									   <input type="radio" name="iskouliang" value="1"/> 开启 &nbsp;&nbsp;&nbsp;&nbsp;
									   <input type="radio" name="iskouliang"  checked value="2"/> 关闭
									</if>	
                                </td>
								<td><input class="btn btn-primary btn2" name="sub" value="设置" type="submit"></td>
							   <td> &nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-primary btn2" href="{:U('System/xiangxi')}" >扣量详细</a></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>

		
        <div class="result-wrap">
            <div class="result-content">
                <form action="" method="post" id="myform" name="myform" enctype="multipart/form-data">
                    <table class="insert-tab" width="100%">
                        <tbody>
						
						  
							
							
						     <tr>
                                <th style="width:200px;">当前扣量</th>
                                <td>
                                   操作
                                </td>
                            </tr>
						
						   <foreach name="re" item="v">
						
							 <tr>
                                <th style="width:200px;">
								
								  当前第{$v.num}个扣量
								
								</th>
                                <td>
                                  <a style="cursor:pointer;" onclick="delkouliang({$v.id})">删除</a>
                                </td>
                            </tr>
							</foreach>
							
                        
                        </tbody></table>
                </form>
            </div>
        </div>

    </div>
    <script>
	   
	   function delkouliang(i){
	   
	     $.post("{:U('System/delkouliang')}",{"id":i},function(re){
		 
		   if(re==1){
		   
		     alert('删除成功');location.reload();
		   
		   }else{
		   
		     alert('删除失败');
		   
		   }
		 
		 })
	   
	   }
	
	
	</script>



